package com.resign.carl.proxy.client;

import com.resign.carl.proxy.service.MyRemote;

import java.rmi.Naming;

/**
 * Created by carl.zhao on 2016/6/20.
 */
public class MyRemoteClient {
    public static void main(String[] args) {
        new MyRemoteClient().go();
    }
    public void go(){
        try{
            MyRemote service = (MyRemote) Naming.lookup("rmi:127.0.0.1/RemoteHello");
            String s = service.sayHello();
            System.out.println(s);
        } catch (Exception ex){
            ex.printStackTrace();
        }
    }
}
